package cn.kgc.kgde.bookstore.controller;

import cn.kgc.kgde.bookstore.entity.OssPolicyResult;
import cn.kgc.kgde.bookstore.entity.ResultInfo;
import cn.kgc.kgde.bookstore.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xiaodai
 * @create 2022-06-13 11:56
 */
@CrossOrigin
@RestController
@RequestMapping("/aliyun/oss")
public class OssController {
    @Autowired
    private OssService ossService;

    //oss上传签名生成
    @RequestMapping(value = "/policy", method = RequestMethod.GET)
    @ResponseBody
    public ResultInfo policy() {
        OssPolicyResult result = ossService.policy();
        return new ResultInfo( 200,"图片上传成功" ,result);
    }
}
